Run our lightweight local generator server to create Storyboard Style Black & White Line Drawings instantly on your own computer (100% offline, zero API fees, sub-second renders).
🪟 Windows Setup (Nvidia / CPU)
🍎 Mac Setup (Apple Silicon M1/M2/M3/M4 / Intel)
1 Open Terminal or Command Prompt
Press Win + R , type cmd, and press Enter.
2 Install Required Python Libraries
Copy
pip install torch torchvision diffusers transformers accelerate fastapi uvicorn
3 Create & Run Server Script
Create a file named local_storyboard_server.py and run it:
Copy Script
# Run in your command prompt:
python local_storyboard_server.py
1 Open Terminal
Press Cmd + Space , type Terminal, and press Enter.
2 Install PyTorch (with Apple Silicon Metal / MPS support)
Copy
pip3 install torch torchvision diffusers transformers accelerate fastapi uvicorn
3 Run the Local Server
Copy Script
# Run in your Mac Terminal:
python3 local_storyboard_server.py
View Python Server Code (local_storyboard_server.py)
import io, base64, torch
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
from diffusers import AutoPipelineForText2Image
app = FastAPI()
app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
device = "cuda" if torch.cuda.is_available() else ("mps" if torch.backends.mps.is_available() else "cpu")
torch_dtype = torch.float16 if device in ["cuda", "mps"] else torch.float32
print(f"Starting Picstacy B&W Storyboard Engine on {device.upper()}...")
pipe = AutoPipelineForText2Image.from_pretrained(
"stabilityai/sd-turbo",
torch_dtype=torch_dtype,
variant="fp16" if device != "cpu" else None
).to(device)
class PromptRequest(BaseModel):
prompt: str
@app.post("/generate")
def generate_frame(req: PromptRequest):
# Enforce B&W line drawing prompt conditioning
full_prompt = f"storyboard style black and white line drawing, clean ink sketch, graphic novel linework, monochrome, minimalist, {req.prompt}"
image = pipe(prompt=full_prompt, num_inference_steps=2, guidance_scale=0.0).images[0]
buffered = io.BytesIO()
image.save(buffered, format="JPEG", quality=85)
img_b64 = base64.b64encode(buffered.getvalue()).decode("utf-8")
return {"imageUrl": f"data:image/jpeg;base64,{img_b64}"}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="127.0.0.1", port=8000)
Test Server Connection
Verifies if http://127.0.0.1:8000 is running on your machine
⚡ Ping Server (127.0.0.1:8000)